Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(storage): add Bucket Get & Delete implementations #5775

Merged
merged 3 commits into from
Mar 23, 2022

Conversation

noahdietz
Copy link
Contributor

Implements both gRPC & HTTP Bucket Get & Delete methods, including basic emulator tests.

Also adds a helper, applyBucketCondsProto, that applies the given BucketConditions to an arbitrary protobuf Message that satisfies the documented field requirements. This uses the same strategy as the applyCondsProto helper for the Conditions type.

@noahdietz noahdietz requested review from a team as code owners March 21, 2022 20:54
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the Cloud Storage API. labels Mar 21, 2022
storage/client_test.go Show resolved Hide resolved
req.UserProject(s.userProject)
}

return run(ctx, func() error { return req.Context(ctx).Do() }, s.retry, s.idempotent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do the settings know the default idempotency value for this delete operation?

Copy link
Contributor Author

@noahdietz noahdietz Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Communicating the idempotency will the responsibility of the transport-agnostic client layer (i.e. the layer above these transport-specific implementations that will call them). It will communicate to this transport-specific layer via the storageOption.idempotent(bool). This is basically the same as it is today, where the transport-agnostic client layer supplies true or false to the run call. Swap out the run call for the transport-client interface call with the option idempotent(true) and we are good to do.

storage/http_client.go Outdated Show resolved Hide resolved
Copy link
Contributor

@BrennaEpp BrennaEpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@noahdietz noahdietz merged commit dfda4d1 into googleapis:main Mar 23, 2022
@noahdietz noahdietz deleted the bucket-get-delete branch March 23, 2022 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants